package com.asset.salesforce.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.FollowCenterDaoImpl;
import com.asset.salesforce.domain.Account;
import com.asset.salesforce.domain.Contact;
import com.asset.salesforce.domain.Employee;
import com.asset.salesforce.domain.FollowCenter;
import com.asset.salesforce.domain.Lead;

@Service
@Transactional(readOnly=true)
public class CheckingUtilsService {
	@Autowired
	private FollowCenterDaoImpl followCenterDaoImpl;
	
	public Boolean checkIfCurrentFollowThatLead(Employee employee,Lead lead) {
		
		List<FollowCenter> centers = new ArrayList<FollowCenter>();
		centers = followCenterDaoImpl.checkIfCurrentFollowThatLead(employee, lead);
		
		if(centers.size()>0){
			return true;
		}else{
			return false;
		}
	}
public Boolean checkIfCurrentFollowThatAccount(Employee employee,Account account) {
		
		List<FollowCenter> centers = new ArrayList<FollowCenter>();
		centers = followCenterDaoImpl.checkIfCurrentFollowThatAccount(employee, account);
		
		if(centers.size()>0){
			return true;
		}else{
			return false;
		}
	}

public Boolean checkIfCurrentFollowThatContact(Employee employee,Contact contact) {
	
	List<FollowCenter> centers = new ArrayList<FollowCenter>();
	centers = followCenterDaoImpl.checkIfCurrentFollowThatContact(employee, contact);
	
	if(centers.size()>0){
		return true;
	}else{
		return false;
	}
}
public Boolean checkIfCurrentFollowThatPeople(Employee follower,Employee followed) {
	
	List<FollowCenter> centers = new ArrayList<FollowCenter>();
	centers = followCenterDaoImpl.checkIfCurrentFollowThatPeople(follower, followed);
	
	if(centers.size()>0){
		return true;
	}else{
		return false;
	}
}
}
